package com.springboot.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.Set;

@Data
@Entity
@Table(name = "bt_demand")
public class BtDemand {
    @Id
    private String id;
    private String bankId;
    private String taskId;
    private String type;
    private String name;
    private String projectSize;            //新开发需求类型
    @Column(length = 2000)
    private String description;
    private String delivery;               //交付物
    private String money;
    private Date deadline;
    private String language;
    private String tecQualification;        //技术资质要求
    private String busQualification;    //业务资质要求
    private String specReq;                 //特殊需求
    private String belongSystem;
    private String belongProject;
    private String paymentWay;
    private String priority;                //优先级
    private String difficulty;             //难度系数
    private String fileIds;
    private String status;                  //是否签约
    private Date createTime;
    private Date modifyTime;
    private Integer platShown;              //平台是否可见
    private Integer outsourcerShown;        //外包商是否可见
    private Integer modifyTimes  = 0;            //需求修改次数
    private Integer views = 0;

    @OneToMany(mappedBy = "demand", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JsonIgnore
    private Set<BtDemandAuthority> authorities;

    @OneToMany(mappedBy = "demand", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JsonIgnore
    private Set<BtTask> tasks;

    @OneToMany(mappedBy = "demand", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JsonIgnore
    private Set<BtTeam> teams;
}
